from basic_module import CombatGame

# Computer 1
game1 = CombatGame()

for line in xrange(4):
    for row in xrange(10):
        game1.add_piece(-1, line, row)
#print '\nGame1:\n',game1.table,'\n'
        
# Computer 2
game2 =  CombatGame()

for line in xrange(4):
    for row in xrange(10):
        game2.add_piece(-1, line, row)
#print '\nGame1:\n',game1.table,'\n'
  
# 3. Playing -----> Rede a partir daqui...

game1.move(3,0,4,0)
#game2.move_shadow(0,0,0,1) # Vira chamada de rede
game2.move(6,9,5,9)
#game1.move_shadow(0,0,0,1) # Vira chamada de rede
game2.move(3,9,4,9)
game1.move(6,0,5,0)

#print '\nGame1:\n',game1.table,'\n'
#print 'Game2:\n',game2.table

# ... Atack missing...

print '\n',game1.table.get(4,0)
print game1.table.get(5,0)
print game2.table.get(4,9)
print game2.table.get(5,9)

#print '\nGame1:\n',game1.table,'\n'

if game1.attack_button(5,0):
    print 'OK, now i can attack....(Game1)'
game1.change_status(2)

real_piece = game1.table.get(4,0) 
print game2.table.get(4,9)
print game2.table.get(5,9)
game2.change_shadow(5,9,real_piece)
print game2.table.get(5,9)
#game2.attack_to(4,9,5,9,real_piece)
#print game2.allied_graveyard
#print game2.allied_graveyard

# And now we have the same attack in the other side

#game2.attack_to(5,9,4,9)

if game2.attack_button(4,9):
    print 'OK, now i can attack you!!!!(Game2)'

# OK ALL READY!!!!!!!!!!!!! ONLY WAITING FOR NET...

